<template>
	<view class="well-list-wrap">
		<view class="list-header">
			<image style="width: 36rpx; height: 36rpx" mode="aspectFit" :src="nearby_icon"></image>
			<view class="list-name">附近井点</view>
		</view>
		<scroll-view v-if="wellList.length" class="well-list" scroll-y="true">
			<view class="well-item" v-for="item in wellList" :key="item.id" @click="handleSelectWell(item)">
				<view class="well-info">
					<view class="well-name">井点信息（{{item.pipNo}}）</view>
					<view class="well-geo">
						<view class="geo-item">经度：{{item.longitude}}</view>
						<view class="geo-item">纬度：{{item.latitude}}</view>
					</view>
				</view>
				<u-icon name="arrow-right" color="#E2E2E2" size="18"></u-icon>
			</view>
		</scroll-view>
		<view v-else class="default-wrap">
			<image style="width: 320rpx; height: 320rpx" mode="aspectFit" :src="nearby_default_icon"></image>
			<view class="default-tip">附近暂无井点</view>
		</view>
	</view>
</template>
<script>
	import nearby_icon from '@/static/equipmentinstallation/nearby_icon.png';
	import nearby_default_icon from '@/static/equipmentinstallation/nearby_default_icon.png';
	export default {
		props: {
			wellList: {
				type: Array,
				default: () => {
					return [];
				}
			}
		},
		data: function() {
			return {
				nearby_icon,
				nearby_default_icon
			};
		},
		methods: {
			handleSelectWell(wellInfo){
				this.$emit( 'selectWell', wellInfo );
			},
		}
	};
</script>
<style scoped lang="scss">
	.well-list-wrap {
		height: 780rpx;
		margin: 16rpx 24rpx 0;
    padding-bottom: 24rpx;
		background: #ffffff;
		box-shadow: 0 -4rpx 16rpx 0 #0000001a;
		border-radius: 40rpx 40rpx 0 0;
		overflow: hidden;
	}

	.list-header {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		height: 85rpx;
		padding: 24rpx 24rpx 0;
		background: #f8f9fb;
	}

	.list-name {
		height: 45rpx;
		margin-left: 8rpx;
		line-height: 45rpx;
		font-size: 32rpx;
		color: #00000099;
	}

	.default-wrap {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
		padding-top: 98rpx;
	}

	.default-tip {
		height: 40rpx;
		padding-top: 24rpx;
		font-size: 28rpx;
		color: #686b73;
	}

	.well-list {
		width: calc(100% - 48rpx);
		height: calc(100% - 140rpx);
		padding: 24rpx;
		margin-bottom: 24rpx;
	}

	.well-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 107rpx;
		padding-top: 24rpx 0;
		border-bottom: 1rpx solid #e7e7e7;
	}

	.well-name {
		height: 45rpx;
		line-height: 45rpx;
		font-size: 32rpx;
		color: #333333;
	}

	.well-geo {
		display: flex;
		justify-items: flex-start;
		align-items: center;
	}

	.geo-item {
		height: 37rpx;
		margin-right: 16rpx;
		font-size: 26rpx;
		color: #00000099;
	}
</style>